import React, {Component} from 'react';
import store from '../../store/index'

class EmsInfo extends Component {
  state = {
    count: 0
  };

  componentDidMount() {
    console.log('componentDidMount');
    store.subscribe(()=>{
      this.setState({
        count: store.getState()
      })
    })
  }

  componentWillUnmount() {
    // store.unSubscribe();
  }

  render() {
    let {count} = this.state;
    window.emsInfo = this;
    console.log(this.props.match.params.id);
    //再请求一次数据
    return (
      <div>
        EmsInfo
        <br/>
        {count}
      </div>
    );
  }
}

export default EmsInfo;
